package db_main

import (
	"fmt"
	"longmen/server/pkg/common/helper/util"
	"longmen/server/pkg/db/mysql"
	"longmen/server/pkg/db/mysql/models/models_main"
)

func GetUserLevelRules() ([]*models_main.UserLevelRule, error) {
	o := make([]*models_main.UserLevelRule, 0)
	err := mysql.GetRTable(&models_main.UserLevelRule{}).
		Order("level ASC").
		Find(&o).
		Error
	if err != nil {
		err = fmt.Errorf("%s%s", util.Convert2(), err.Error())
	}
	return o, err
}
